package com.aaron.demo1.common.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson配置类
 *
 * @author liurong
 * @date 2021/7/9 17:41
 */
@Configuration
public class MyRedissonConfig {

    @Bean
    RedissonClient redisson(){
        Config config = new Config();
//        config.useClusterServers();
        config.useSingleServer().setAddress("redis://localhost:6379").setDatabase(0);
        return Redisson.create(config);
    }

}
